checkdate
Verify the Gregorian calendar date
checkdate()
function is used to verify the Gregorian date.
Check if some dates are valid Gregory dates:
<?php var_dump ( checkdate ( 12 , 31 , - 400 ) ) ; echo "<br>" ; var_dump ( checkdate ( 2 , 29 , 2003 ) ) ; echo "<br>" ; var_dump ( checkdate ( 2 , 29 , 2004 ) ) ; ?>
Try it yourself
checkdate ( month , day , year ) ;
parameter | describe |
---|---|
month | Required. Specifies a numerical value from 1 to 12 months. |
day | Required. The specified date is a numerical value from 1 to 31. |
year | Required. Specifies a numerical value from 1 to 32767. |